#include "resource.h"

#include <filesystem>
#include <sstream>


namespace resource
{

static const fs::path kReourceDir = MY_RESOURCE_DIR;

fs::path find(const std::string &name)
{
    const fs::path p = kReourceDir / name;
    if (!fs::exists(p)) {
        std::ostringstream ss;
        ss << "Cannot find resource [" << name << "]";
        throw std::runtime_error(ss.str());
    }

    return p;
}

}
